{% load filter %}
<div class="container">
    <div class="row">
        {% for course in courses %}
            <div class="col-sm-6 col-md-4">
                <div class="thumbnail">
                    <a href="{% url 'videoPlayer' course.courseurl course.id course.id|getCourseVideoId %}" target="_blank"><img src="{{ course.imgurl }}"></a>
                    <div class="caption">
                        <a style="text-decoration: none;" href="{% url 'videoPlayer' course.courseurl course.id course.id|getCourseVideoId %}" target="_blank"><h3>{{ course.videoname }}</h3></a>
                        <p>{{ course.coursename }}</p>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>

    <nav aria-label="Page navigation">
        <ul class="pagination pagination-lg">
            {% if page == 1 %}
                <li class="disabled">
                    <a href="javascript:;" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            {% else %}
                <li>
                    <a href="{% url 'courses' grade_url subject pre %}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            {% endif %}
            {% for number in numbers %}
                {% if number == page %}
                    <li class="active"><a href="{% url 'courses' grade_url subject number %}">{{ number }}</a></li>
                {% else %}
                    <li><a href="{% url 'courses' grade_url subject number %}">{{ number }}</a></li>
                {% endif %}
            {% endfor %}
            {% if page == maxPage %}
                <li class="disabled">
                    <a href="javascript:;" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            {% else %}
                <li>
                    <a href="{% url 'courses' grade_url subject next %}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            {% endif %}

        </ul>
    </nav>
</div>